import { Observable } from 'rxjs'
import {
  User,
  IUserPagination,
  IUserQueryParams,
  UserRole,
  IUpdateUser,
  IChangePassword,
  ICreateUserForm,
} from '@shared/interfaces/user'
import { ERoleType } from '@shared/enums'

export abstract class UserService {
  abstract getList(params: IUserQueryParams): Observable<IUserPagination>

  abstract update(username: string, params: IUpdateUser): Observable<User>

  abstract current(): Observable<User>

  abstract create(user: ICreateUserForm): Observable<string>

  abstract delete(username: string): Observable<boolean>

  abstract freeze(username: string): Observable<boolean>

  abstract unfreeze(username: string): Observable<boolean>

  abstract changePassword(username: string, params: IChangePassword): Observable<User>

  abstract changeMePassword(IChangePassword): Observable<boolean>

  abstract getAcquirerRole(insCode: string, type: ERoleType): Observable<UserRole[]>

  abstract getOne(userName: string): Observable<User>
}
